﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGeBoundBlock2d : OdGeEntity2d
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGeBoundBlock2d(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGeBoundBlock2d_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGeBoundBlock2d obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGeBoundBlock2d()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGeBoundBlock2d(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdGeBoundBlock2d() : this(GlobalsPINVOKE.new_OdGeBoundBlock2d__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeBoundBlock2d(OdGePoint2d point1, OdGePoint2d point2) : this(GlobalsPINVOKE.new_OdGeBoundBlock2d__SWIG_1(OdGePoint2d.getCPtr(point1), OdGePoint2d.getCPtr(point2)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeBoundBlock2d(OdGePoint2d arg0, OdGeVector2d dir1, OdGeVector2d dir2) : this(GlobalsPINVOKE.new_OdGeBoundBlock2d__SWIG_2(OdGePoint2d.getCPtr(arg0), OdGeVector2d.getCPtr(dir1).Handle, OdGeVector2d.getCPtr(dir2).Handle), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeBoundBlock2d(OdGeBoundBlock2d source) : this(GlobalsPINVOKE.new_OdGeBoundBlock2d__SWIG_3(OdGeBoundBlock2d.getCPtr(source)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getMinMaxPoints(OdGePoint2d p1, OdGePoint2d p2)
		{
			GlobalsPINVOKE.OdGeBoundBlock2d_getMinMaxPoints(this.swigCPtr, OdGePoint2d.getCPtr(p1), OdGePoint2d.getCPtr(p2));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void get(OdGePoint2d arg0, OdGeVector2d side1, OdGeVector2d side2)
		{
			GlobalsPINVOKE.OdGeBoundBlock2d_get(this.swigCPtr, OdGePoint2d.getCPtr(arg0), OdGeVector2d.getCPtr(side1).Handle, OdGeVector2d.getCPtr(side2).Handle);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeBoundBlock2d set(OdGePoint2d p1, OdGePoint2d p2)
		{
			OdGeBoundBlock2d result = new OdGeBoundBlock2d(GlobalsPINVOKE.OdGeBoundBlock2d_set__SWIG_0(this.swigCPtr, OdGePoint2d.getCPtr(p1), OdGePoint2d.getCPtr(p2)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeBoundBlock2d set(OdGePoint2d arg0, OdGeVector2d side1, OdGeVector2d side2)
		{
			OdGeBoundBlock2d result = new OdGeBoundBlock2d(GlobalsPINVOKE.OdGeBoundBlock2d_set__SWIG_1(this.swigCPtr, OdGePoint2d.getCPtr(arg0), OdGeVector2d.getCPtr(side1).Handle, OdGeVector2d.getCPtr(side2).Handle), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeBoundBlock2d extend(OdGePoint2d point)
		{
			OdGeBoundBlock2d result = new OdGeBoundBlock2d(GlobalsPINVOKE.OdGeBoundBlock2d_extend(this.swigCPtr, OdGePoint2d.getCPtr(point)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeBoundBlock2d swell(double distance)
		{
			OdGeBoundBlock2d result = new OdGeBoundBlock2d(GlobalsPINVOKE.OdGeBoundBlock2d_swell(this.swigCPtr, distance), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool contains(OdGePoint2d point)
		{
			bool result = GlobalsPINVOKE.OdGeBoundBlock2d_contains(this.swigCPtr, OdGePoint2d.getCPtr(point));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isDisjoint(OdGeBoundBlock2d block)
		{
			bool result = GlobalsPINVOKE.OdGeBoundBlock2d_isDisjoint(this.swigCPtr, OdGeBoundBlock2d.getCPtr(block));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeBoundBlock2d Assign(OdGeBoundBlock2d block)
		{
			OdGeBoundBlock2d result = new OdGeBoundBlock2d(GlobalsPINVOKE.OdGeBoundBlock2d_Assign(this.swigCPtr, OdGeBoundBlock2d.getCPtr(block)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isBox()
		{
			bool result = GlobalsPINVOKE.OdGeBoundBlock2d_isBox(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeBoundBlock2d setToBox(bool toBox)
		{
			OdGeBoundBlock2d result = new OdGeBoundBlock2d(GlobalsPINVOKE.OdGeBoundBlock2d_setToBox(this.swigCPtr, toBox), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
